//package com.dmxh.orderMQ;
//
//import com.dmxh.result.Result;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.Message;
//import org.springframework.messaging.MessageHeaders;
//import org.springframework.messaging.support.MessageBuilder;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@RestController
//@RequestMapping("/mq")
//public class orderMQ {
//
//    @Autowired
//    private RocketMQTemplate rocketMQTemplate;
//
//    //测试延迟消息
//    @GetMapping("/sendMQ")
//    public Result sendMQ() {
//        String msg = "woshi1xiaoxi";
//        Message<String> message = MessageBuilder.withPayload(msg)
//                .setHeader(MessageHeaders.CONTENT_TYPE, "text/plain")
//                .build();
//        rocketMQTemplate.syncSend("topic", message, 3000, 3);
//        return Result.ok();
//    }
//}
